package com;

import java.time.LocalDateTime;
import java.util.List;

public class Receptionist extends User {
    public Receptionist(String userId, String username, String password,
                        LocalDateTime registerTime, String phone) {
        super(userId, username, password, registerTime, "前台", phone);
                                                                  }
    @Override
    public boolean login(String inputUsername, String inputPassword) {
        return this.getUsername().equals(inputUsername) && this.getPassword().equals(inputPassword);
                                                                     }

    public void listSchedulesInDays(List<Schedule> scheduleList, int days) {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime endTime = now.plusDays(days);

        System.out.println("\n未来" + days + "天场次：");
        for (Schedule schedule : scheduleList) {
            if (schedule.getShowTime().isAfter(now) && schedule.getShowTime().isBefore(endTime)) {
                System.out.println("影片: " + schedule.getMovie().getTitle() +
                        " | 时间: " + schedule.getShowTime() +
                        " | 放映厅: " + schedule.getHall().getHallId() +
                        " | 票价: " + schedule.getPrice());                                       }
                                               }                           }
                                     }
